<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../000-assets/js/react.development.js"></script>
    <script src="../000-assets/js/react-dom.development.js"></script>
    <script src="../000-assets/js/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">
      const array = ["孙悟空", "猪八戒", "沙和尚"];

      // 其实很简单，直接通过map方法，把数组中的每一项，转换成li标签即可
      let list = array.map((item) => <li key={item}>{item}</li>);

      const root = ReactDOM.createRoot(document.querySelector("#root"));
      root.render(list);
    </script>
  </body>
</html>
